---
title: Sync hearing schedule to Guidewire
summary: Pushes matter and activity updates for a hearing schedule to the Guidewire claim system, with a best-effort, non-blocking failure mode.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-006
trigger: Schedule save (clsScheduleManager / clsAssignmentManager)
---

# Sync hearing schedule to Guidewire

This operation builds a Guidewire "matter" request from a legal hearing schedule and synchronizes it to the Guidewire claim system, optionally also pushing a related claim activity reminder.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-006 |
| **Trigger** | Hearing schedule save (`clsScheduleManager.SendDataToGw` / `clsAssignmentManager.SendDataToGw`) |
| **Inputs** | `clsLegalSchedule` |
| **Outputs** | Guidewire matter/activity record (external system) |
| **Primary components** | `clsScheduleManager.SendDataToGw`, `clsAssignmentManager.SendDataToGw`, `clsScheduleManager.CreateScheduleActivity` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vb` |

## Steps

1. Build a `GwMatterRequest` from the `clsLegalSchedule`: case number, status, secretary/attorney user IDs, matter date/type, and — for closed/settled/dismissed statuses — a computed `matterClosedEffDate`.
2. Check whether an attorney is currently assigned (`req.saifAttorneyName <> ""`) ([BR-LGL-007](../business-rules.md#br-lgl-007-hearing-schedule-sync-to-guidewire-requires-an-assigned-attorney)).
   - If no attorney is assigned: skip the Guidewire call entirely; no matter is created/updated.
3. If an attorney is assigned: call the `GwMatterApi` API client (`DPI.ApiClients.Item("GwMatterApi")`) via a `RetrieveWithBody` route (create).
   - On failure of the create call: retry as an `Update` route call.
     - On failure of the retry: log the exception via `Logging.clsLogError.CreateError` without surfacing it to the caller ([BR-LGL-008](../business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save)).
4. If the schedule type is `HEAR` or `MED` and the sync succeeded: call `CreateScheduleActivity` to also push a Guidewire claim activity (hearing/mediation reserve reminder, due in 30 days).
   - On failure: log via `Logging.clsLogError.CreateError` without surfacing it to the caller ([BR-LGL-008](../business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save)).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Schedule saved]) --> Build[Build GwMatterRequest]
	Build --> Assigned{Attorney assigned?}
	Assigned -->|No| Skip([Skip Guidewire sync])
	Assigned -->|Yes| Create[GwMatterApi RetrieveWithBody create]
	Create --> CreateOk{Succeeded?}
	CreateOk -->|Yes| Type{Type HEAR or MED?}
	CreateOk -->|No| Update[GwMatterApi Update route]
	Update --> UpdateOk{Succeeded?}
	UpdateOk -->|Yes| Type
	UpdateOk -->|No| LogErr[Log error<br>no failure surfaced]
	Type -->|Yes| Activity[CreateScheduleActivity<br>reminder due 30 days]
	Type -->|No| EndOk([Done])
	Activity --> EndOk
	LogErr --> EndOk
```

## Failure and edge-case behavior

- No attorney assigned: the sync is skipped entirely — this is a normal, expected branch, not an error.
- Create-route failure: automatically retried as an update-route call before being treated as a failure.
- Any Guidewire failure (create, update, or activity push): logged via `Logging.clsLogError.CreateError` and never surfaced to the caller or the underlying case save ([BR-LGL-008](../business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsAssignmentManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\GwMatterRequest.vb`
